package mt.filter.user;

/**
 * Represents a user and a time stamp 
 *
 */
public class TimeStampedUser implements Comparable{
	private String userName;
	private double timeStamp;
	
	public TimeStampedUser(String userName, double timeStamp){
		this.userName = userName;
		this.timeStamp = timeStamp;
	}

	/**
	 * Compares the TimeStampedUser by username
	 */
	@Override
	public boolean equals(Object other) {
		return this.userName.equals(((TimeStampedUser)other).userName);
	}

	@Override
	public int compareTo(Object other) {
		return (int)(this.timeStamp-((TimeStampedUser)other).timeStamp);
	}

	public double getTimeStamp(){
		return timeStamp;
	}
	
}
